const pathWithTitle = {
  '/': '首页',

  '/zhongzhijishu/baicaixingyoucai': '白菜型油菜',
  '/zhongzhijishu/ganlanxingyoucai': '甘蓝型油菜',
  '/zhongzhijishu/jiecaixingyoucai': '芥菜型油菜',
  '/zhongzhijishu/chunyoucai': '春油菜',
  '/zhongzhijishu/dongyoucai': '冬油菜',

  '/zhongzhiguanli/zhongzhijilu': '种植记录',
  '/zhongzhiguanli/shouyiyugu': '收益预估',
  // '/zhongzhiguanli/zhongzhijuece': '种植决策',

  // 机械管理
  '/jixieguanli/ziyounongji': '使用历史', // 改过页面名称
  '/jixieguanli/zhejiufei': '折旧费',
  '/jixieguanli/weixiufei': '维修费',
  '/jixieguanli/jizushengchanlv': '机组生产率',
  '/jixieguanli/zuoyechengben': '作业成本',

  // 机械信息
  '/jixiexinxi/youcaibozhongji': '油菜播种机',
  '/jixiexinxi/youcaishougeji': '油菜收割机',
  '/jixiexinxi/youcaituoliji': '油菜脱粒机',
  '/jixiexinxi/nongjizulin': '农机租赁',
  '/jixiexinxi/gengdi': '耕地',
  '/jixiexinxi/zhengdi': '整地',
  '/jixiexinxi/bozhong': '播种',
  '/jixiexinxi/tianjianguanli': '田间管理',
};

/**
 * 检查 path 是否存在于规定的所有页面的集合中
 * @param path
 * @returns {boolean}
 */
export function pathExists(path) {
  return Object.keys(pathWithTitle).includes(path)
}

/**
 * 依据 path 获取到页面的 名称
 * @param path
 * @returns {*}
 */
export function getRouteTitle(path) {
  return pathWithTitle[path];
}


export default [
  {
    id: '0',
    name: 'index',
    route: '/',
    hide: true, // 不显示 重定向到 /dashboard
  },

  {
    id: 'zhongzhijishu',
    name: '种植技术',
    route: '/zhongzhijishu',
    children: [
      {
        id: 'zhongzhijishu_anpinzhongfenpei',
        name: '按品种分类',
        children: [
          {
            id: 'zhongzhijishu_baicaixingyoucai',
            name: '白菜型油菜',
            route: '/zhongzhijishu/baicaixingyoucai',
          },
          {
            id: 'zhongzhijishu_ganlanxingyoucai',
            name: '甘蓝型油菜',
            route: '/zhongzhijishu/ganlanxingyoucai',
          },
          {
            id: 'zhongzhiguanli_jiecaixingyoucai',
            name: '芥菜型油菜',
            route: '/zhongzhijishu/jiecaixingyoucai',
          },
        ],
      },

      {
        id: 'zhongzhijishu_anshijianfenpei',
        name: '按时间分类',
        children: [
          {
            id: 'zhongzhijishu_chunyoucai',
            name: '春油菜',
            route: '/zhongzhijishu/chunyoucai',
          },
          {
            id: 'zhongzhijishu_dongyoucai',
            name: '冬油菜',
            route: '/zhongzhijishu/dongyoucai',
          },
        ],
      },
    ],
  },

  {
    id: 'zhongzhiguanli',
    name: '种植管理',
    route: '/zhongzhiguanli',
    children: [
      {
        id: 'zhongzhiguanli_zhongzhijilu',
        name: '种植记录',
        route: '/zhongzhiguanli/zhongzhijilu',
      },
      {
        id: 'zhongzhiguanli_shouyiyugu',
        name: '收益预估',
        route: '/zhongzhiguanli/shouyiyugu',
      },
      // {
      //   id: 'zhongzhiguanli_zhongzhijuece',
      //   name: '种植决策',
      //   route: '/zhongzhiguanli/zhongzhijuece',
      // },
    ],
  },

  {
    id: 'jixieguanli',
    name: '机械管理',
    route: '/jixieguanli',
    children: [
      {
        id: 'jixieguanli_ziyounongji',
        name: '使用历史',
        route: '/jixieguanli/ziyounongji',
      },
      {
        id: 'jixieguanli_guanlijuece',
        name: '管理决策',
        route: '/jixieguanli/guanlijuece',
        children: [
          {
            id: 'jixieguanli_zhejiufei',
            name: '折旧费',
            route: '/jixieguanli/zhejiufei',
          },
          {
            id: 'jixieguanli_weixiufei',
            name: '维修费',
            route: '/jixieguanli/weixiufei',
          },
          {
            id: 'jixieguanli_jizushengchanlv',
            name: '机组生产率',
            route: '/jixieguanli/jizushengchanlv',
          },
          {
            id: 'jixieguanli_zuoyechengben',
            name: '作业成本',
            route: '/jixieguanli/zuoyechengben',
          },
        ],
      },
    ],
  },


  {
    id: 'jixiexinxi',
    name: '机械信息',
    route: '/jixiexinxi',
    children: [
      {
        id: 'jixiexinxi_youcainongji',
        name: '油菜农机',
        children: [
          {
            id: 'jixiexinxi_youcaibozhongji',
            name: '油菜播种机',
            route: '/jixiexinxi/youcaibozhongji',
          },
          {
            id: 'jixiexinxi_youcaishougeji',
            name: '油菜收割机',
            route: '/jixiexinxi/youcaishougeji',
          },
          {
            id: 'jixiexinxi_youcaituoliji',
            name: '油菜脱粒机',
            route: '/jixiexinxi/youcaituoliji',
          },
        ],
      },
      {
        id: 'jixiexinxi_nongjinongyi',
        name: '农机农艺',
        children: [
          {
            id: 'jixiexinxi_gengdi',
            name: '耕地',
            route: '/jixiexinxi/gengdi',
          },
          {
            id: 'jixiexinxi_zhengdi',
            name: '整地',
            route: '/jixiexinxi/zhengdi',
          },
          {
            id: 'jixiexinxi_bozhong',
            name: '播种',
            route: '/jixiexinxi/bozhong',
          },
          {
            id: 'jixiexinxi_tianjianguanli',
            name: '田间管理',
            route: '/jixiexinxi/tianjianguanli',
          },
        ],
      },
      {
        id: 'jixiexinxi_nongjizulin',
        name: '农机租赁',
        route: '/jixiexinxi/nongjizulin',
      },
    ],
  },
];
